import request from '@/utils/request'

export function getclassTeacherList(data) {
  if (data.gradeName == '') {
    return request({
      url: `/asTeacherclass/listByTeacherId?keyword=${data.keyword}&limit=${data.limit}&page=${data.page}&teacherId=${data.teacherId}`,
      method: 'get'
    })
  }
  if (data.gradeName != '') {
    return request({
      url: `/asTeacherclass/listByTeacherId?gradeName=${data.gradeName}&keyword=${data.keyword}&limit=${data.limit}&page=${data.page}&teacherId=${data.teacherId}`,
      method: 'get'
    })
  }
}

export function getclasswithoutTeacherList(data) {
  if (data.gradeName == '') {
    return request({
      url: `/asTeacherclass/listClassWithoutTeacher?keyword=${data.keyword}&limit=${data.limit}&page=${data.page}&teacherId=${data.teacherId}`,
      method: 'get'
    })
  }
  if (data.gradeName != '') {
    return request({
      url: `/asTeacherclass/listClassWithoutTeacher?gradeName=${data.gradeName}&keyword=${data.keyword}&limit=${data.limit}&page=${data.page}&teacherId=${data.teacherId}`,
      method: 'get'
    })
  }
}

// 新增
export function addclassTeacherList(data) {
  return request({
    url: '/asTeacherclass/add',
    method: 'post',
    data
  })
}

// 新增一个
export function addList(data) {
  return request({
    url: '/asTeacherclass/addOne',
    method: 'post',
    data
  })
}

// 删除
export function deleteclassTeacherList(data) {
  return request({
    url: `/asTeacherclass/delete/${data.asTeacherclassId}`,
    method: 'post'
  })
}

// 批量删除
export function deleteclassTeacherLists(data) {
  return request({
    url: `/asTeacherclass/deleteList?ids%5B%5D=${data.item}`,
    method: 'post'
  })
}
